package wake.up;

import java.io.File;
import java.util.Calendar;
import java.util.Date;

import android.content.Context;

public class Util {

	public static String getformatedDateToday() {
		Calendar reveil = Calendar.getInstance();

		Date date = reveil.getTime();

		String strDate = formatDate(date);

		return strDate;

	}

	// La fonction de formatage de date
	public static String formatDate(Date d) {
		String strDate = "";

		strDate += d.getDate();
		strDate += "_";

		strDate += d.getMonth();
		strDate += "_";

		strDate += d.getYear();

		return strDate;
	}

	// La fonction de formatage de path, transforme une date en path du son
	public static String formatPathSong(Date d, Context context) {
		String filePath = Util.formatDate(d) + ".mp3";

		File mp3File = context.getFileStreamPath(filePath);
		return mp3File.getAbsolutePath();

	}

}
